<template>
  <div class="main-contain">
    <div class="contain-header">
      <div class="header-left">
        <div class="left-name">{{ currentDoc.name }}</div>
        <div class="left-time"><span v-if="list.data.length > 0">上次修改于</span> {{ currentDoc.mtime }}</div>
      </div>
      <div class="header-right">
        <el-button v-if="list.data.length > 0" size="mini" type="primary" class="el-icon-edit" @click="edit"> 编辑</el-button>
      </div>
    </div>
    <div class="contain-content">
      <dmavon-editor :content.sync="currentDoc.content" :isEdit="false" edit="preview" />
    </div>
  </div>
</template>

<script>
import dmavonEditor from '@/components/mavonEditor'
export default {
  components: {
    dmavonEditor
  },
  props: {
    list: {
      type: Object
    },
    type: {
      type: String
    },
    currentDoc: {
      type: Object
    }
  },
  data () {
    return {
    }
  },
  methods: {
    edit () {
      this.$emit('update:type', 'edit')
    },
  }
}
</script>

<style lang="scss" scoped>
/deep/ .v-note-wrapper {
  border: 0;
}
</style>